﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Permissions;

namespace Engine.POI
{

    /// Garmin - http://www.poi-factory.com/garmin-csv-file-format
    /// http://www.gps-data-team.com/convert.php
    /// GPX - http://www.topografix.com/gpx.asp
    /// GPX file sample - http://www.topografix.com/gpx_sample_files.asp


    /// <summary>
    /// Type of speed camera
    ///      1 - fixed speed camera locations
    ///      2 - combined red light and speed cameras
    ///      3 - fixed red light camera locations
    ///      4 - section camera positions
    ///      5 - lasers, hand-held radars and other mobile speed camera locations
    ///      6 - railway crossing
    ///      7 - not constant mobile locations
    /// </summary>    
   [System.Runtime.InteropServices.ComVisibleAttribute(true)]
    public enum CameraType:short
    {
        Fixed=1,
        Combined=2,
        FixedRedLight=3,
        Section=4,
        Laser=5,
        RailwayCrossing=6,
        NotConstant=7
    };

    /// <summary>
    /// Type of direction of the speedcam
    ///     0 - all directions
    ///     1 - one direction
    ///     2 - both directions
    /// </summary>    
   [System.Runtime.InteropServices.ComVisibleAttribute(true)]
    public enum CameraDirection:short
    {
        Unknown=-1,
        All=0,
        One=1,
        Both=2
    };

    [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
    [System.Runtime.InteropServices.ComVisibleAttribute(true)]
    class CameraPoi:BasePoi
    {
        /// <summary>
        /// [X,Y,TYPE,SPEED,DIRTYPE,ANGLE]
        /// X = longitude 
        /// Y = latitude 
        /// TYPE = type of speed camera 
        ///      1 - fixed speed camera locations; 
        ///      2 - combined red light and speed cameras;
        ///      3 - fixed red light camera locations;
        ///      4 - section camera positions;
        ///      5 - lasers, hand-held radars and other mobile speed camera locations;
        ///      6 - railway crossing;
        ///      7 - not constant mobile locations
        /// SPEED = speed limit in km/h 
        /// DIRTYPE = type of direction of the speedcam 
        ///     0-all directions;
        ///     1-one direction;
        ///     2-both directions
        /// DIRECTION = direction in degrees 
        ///     0-North;
        ///     90-East
        /// DIRTYPE and DIRECTION are optional fields 
        /// </summary>
       

        CameraType type;
        int speed;
        CameraDirection direction;
        float angle;


        #region Properties

        /// <summary>
        /// Camera type
        /// </summary>
        public CameraType Type
        {
            get { return type; }
            set { type =value; }
        }

        /// <summary>
        /// Camera speed activation (km/h)
        /// </summary>
        public int Speed
        {
            get { return speed; }
            set { speed = value; }
        }

        /// <summary>
        /// Camera direction
        /// </summary>
        public CameraDirection Direction
        {
            get { return direction; }
            set { direction = value; }
        }

        /// <summary>
        /// Camera direction in degrees
        /// </summary>
        public float Angle
        {
            get { return angle; }
            set { angle = value; }
        }

        #endregion


        /// <summary>
        /// Camera POI
        /// </summary>
        public CameraPoi()
            : base()
        {

        }
    }
}
